home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / comm / net / tf02.lha / TinyFugue / tf-lib / filexfer.tf < prev    next >
Text File  |  1995-08-12  |  2KB  |  67 lines

  1. ;;;; File transfer macros
  2. ;; see "/help /putfile" and "/help /getfile".
  3.  
  4. /~loaded file-xfer.tf
  5.  
  6. /def -i putfile = /putfile_MUCK %*
  7.  
  8. /def -i putfile_MUCK =\
  9.     @edit %{2-%{1}}%;\
  10.     i%;\
  11.     /quote -S '%1%;\
  12.     .%;\
  13.     q
  14.  
  15. /def -i putfile_UNIX =\
  16.     ed %{2-%{1}}%;\
  17. ;   "1,$c" would be easier than "1,$d" "a", but doesn't work with LP's ed.
  18.     1,$$d%;\
  19.     a%;\
  20.     /quote -S '%1%;\
  21.     .%;\
  22.     w%;\
  23.     q
  24.  
  25. ; I'm told that this works.
  26. /def -i putfile_LP = /putfile_UNIX %*
  27.  
  28. ;;; Mud-to-local file transfer:  /getfile <file> [<remote-file>]
  29. ; Note: if there is a log open for the current world, it will be closed.
  30.  
  31. /def -i getfile = /getfile_MUCK %*
  32.  
  33. /def -i getfile_MUCK =\
  34.     /def -i -w -1 -aG -p98 -msimple -t"Editor exited." _getfile_end =\
  35.         /log -w OFF%%;\
  36.         /undef _getfile_quiet%;\
  37.     /def -i -w -1 -p99 -msimple -t"Entering editor." _getfile_start =\
  38.         /sys rm -f %1%%;\
  39.         /log -w %1%%;\
  40.         /def -i -w -p97 -ag -mglob -t"*" _getfile_quiet%;\
  41.     @edit %{2-%{1}}%;\
  42.     1 99999 l%;\
  43.     q
  44.  
  45. /def -i getfile_LP =\
  46.     /def -i -w -1 -aG -p98 -msimple -t":Exit from ed." _getfile_end =\
  47.         /log -w OFF%%;\
  48.         /undef _getfile_quiet%;\
  49.     /def -i -w -1 -p99 -mregexp -t"^:(.*)$$" _getfile_start =\
  50.         /sys rm -f %1%%;\
  51.         /log -w %1%%;\
  52.         /def -i -w -p97 -ag -mglob -t"*" _getfile_quiet%%;\
  53.         /test substitute(P1)%;\
  54.     ed %{2-%{1}}%;\
  55.     1,$$p%;\
  56.     q
  57.  
  58. /def -i getfile_UNIX =\
  59.     /def -i -w -1 -agG -p98 -msimple -t"GETFILE DONE" getfile_end =\
  60.         /log -w OFF%%;\
  61.         /undef _getfile_quiet%;\
  62.     /sys rm -f %1%;\
  63.     /log -w %1%;\
  64.     /def -i -w -p97 -ag -mglob -t"*" _getfile_quiet%;\
  65.     cat %{2-%{1}}; echo GETFILE DONE
  66.  
  67.